Skip to content

Conversation

svozza
Copy link
Contributor

@svozza svozza commented Oct 16, 2025

Summary

This PR introduces the new InvokeStore module that fetches the X-ray trace id from AsyncLocalStorage if it is available.

Changes

Updated the getXrayTraceDataFromEnv function in envUtils to check AsyncLocalStorage first and fall back to the _X_AMZN_TRACE_ID environment variable otherwise.

Also updated the envUtils tests to use unstubAllEnvs rather than directly mutate process.env.

Issue number: closes #4657


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@boring-cyborg boring-cyborg bot added commons This item relates to the Commons Utility dependencies Changes that touch dependencies, e.g. Dependabot, etc. tests PRs that add or change tests labels Oct 16, 2025
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Oct 16, 2025
@svozza svozza requested a review from sdangol October 16, 2025 21:57
@svozza svozza force-pushed the invoke-store-x-ray branch from 271c754 to ff08098 Compare October 16, 2025 22:24
@svozza svozza force-pushed the invoke-store-x-ray branch from ff08098 to d9484c4 Compare October 16, 2025 22:33
Copy link

@svozza svozza changed the title improv(commons): Make trace ID access more robust improv(commons): Make X-rRay trace ID access more robust Oct 17, 2025
@svozza svozza merged commit 5199d3e into main Oct 17, 2025
39 checks passed
@svozza svozza deleted the invoke-store-x-ray branch October 17, 2025 08:18
@svozza svozza changed the title improv(commons): Make X-rRay trace ID access more robust improv(commons): Make X-Ray trace ID access more robust Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commons This item relates to the Commons Utility dependencies Changes that touch dependencies, e.g. Dependabot, etc. size/L PRs between 100-499 LOC tests PRs that add or change tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maintenance: Leverage new InvokeStore module to keep track of X-RAY trace id

2 participants